package net.cloudcodex.client.campaign.view;

import java.util.Date;

import net.cloudcodex.client.campaign.view.CampaignsView.Message;
import net.cloudcodex.client.campaign.view.panel.CampaignConfigPanel;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.dom.client.HasKeyDownHandlers;
import com.google.gwt.event.dom.client.HasKeyUpHandlers;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.inject.Inject;

public class CampaignConfigViewImpl extends ScrollPanel implements
		CampaignConfigView {
	
	private CampaignConfigPanel campaignInfosPanel = new CampaignConfigPanel();

	@Inject
	public CampaignConfigViewImpl(Message message) {
		campaignInfosPanel.setMessage(message);
		this.add(campaignInfosPanel);
		
	}
	
	@Override
	public void addCampaignInfos(String name, String icon, String game,
			Date creationDate) {
		campaignInfosPanel.addCampaignInfos(name, icon, game,
				creationDate);
	}

	@Override
	public void refreshCampaignInfos(String name, String icon, String game){
		campaignInfosPanel.refreshCampaignInfos(name, icon, game);
		
	}
	
	
	@Override
	public void initView() {
		campaignInfosPanel.initComponent();

		
	}

	@Override
	public HasClickHandlers getModifyButton() {
		return campaignInfosPanel.getActionButton() ;
	}
	
	@Override
	public HasKeyDownHandlers getDescriptionTexteAreaKeyDown(){
		return campaignInfosPanel.getDescriptionTexteAreaKeyDown();
	}
	@Override
	public HasKeyUpHandlers getDescriptionTexteAreaKeyUp(){
		return campaignInfosPanel.getDescriptionTexteAreaKeyUp();
	}
	@Override
	public HasKeyDownHandlers getNameTextBoxKeyDown(){
		return campaignInfosPanel.getNameTextBoxKeyDown();
	}
	@Override
	public HasKeyDownHandlers getGameTextBoxKeyDown(){
		return campaignInfosPanel.getGameTextBoxKeyDown();
	}
	@Override
	public HasKeyDownHandlers getIconTextBoxKeyDown(){
		return campaignInfosPanel.getIconTextBoxKeyDown();
	}
	@Override
	public HasKeyUpHandlers getNameTextBoxKeyUp(){
		return campaignInfosPanel.getNameTextBoxKeyUp();
	}
	@Override
	public HasKeyUpHandlers getGameTextBoxKeyUp(){
		return campaignInfosPanel.getGameTextBoxKeyUp();
	}
	@Override
	public HasKeyUpHandlers getIconTextBoxKeyUp(){
		return campaignInfosPanel.getIconTextBoxKeyUp();
	}

	@Override
	public void setModifyButtonEnable(boolean enable) {
		campaignInfosPanel.setActionButtonEnable(enable);
	}

	@Override
	public String getCampaignName() {
		return campaignInfosPanel.getCampaignName();
	}

	@Override
	public String getCampaignGame() {
		return campaignInfosPanel.getCampaignGame();
	}

	@Override
	public String getCampaignIcon() {
		return campaignInfosPanel.getCampaignIcon();
	}

	@Override
	public String getCampaignDescription() {
		return campaignInfosPanel.getCampaignDescription();
	}

}
